# Makefile for fearofthemap project.

# Add your files here :
ML=types.ml image.ml io.ml point.ml triangle.ml parser.ml image_functions.ml grapheng.ml process_types.ml process.ml args_manager.ml gui.ml main.ml
MLI=types.mli image.mli io.mli point.mli trianle.mli parser.mli image_functions.mli grapheng.mli process_types.mli process.mli args_manager.mli gui.mli

# Please change this with careful !
# Do not touch if you don't know what you're doing.
OCAMLFLAGS= -I +sdl -I +lablgtk2 -I +glMLite
OCAMLLD=lablgtk.cmxa unix.cmxa bigarray.cmxa sdl.cmxa sdlloader.cmxa GL.cmxa Glu.cmxa Glut.cmxa

# You Can't Touch This - MC Hammer
# Now please do not modify what is following.
OCAMLOPT=ocamlopt
OCAMLDEP=ocamldep
EXEC=fearofthemap

CMX=$(ML:%.ml=%.cmx)
CMI=$(MLI:%.mli=%.cmi)

all: $(EXEC)

.SUFFIXES: .ml .mli .cmi .cmx

$(EXEC): $(CMX)
	$(OCAMLOPT) $(OCAMLLD) $(OCAMLFLAGS) $^ -o $(EXEC)

.ml.cmx:
	$(OCAMLOPT) $(OCAMLFLAGS) -c $< 

.mli.cmi:
	$(OCAMLOPT) $(OCAMLFLAGS) -c $<

# Dependencies

include .depend

.depend:
	rm -f .depend
	$(OCAMLDEP) $(OCAMLLD) $(MLI) $(ML) > .depend

# Clean me all that shit !

clean:
	rm -rf *.cm[xio] *.o
	rm -f .depend

distclean: clean
	find . -name "*~" -exec rm '{}' \;
	rm -f $(EXEC) interface

# EOF